
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
include '../lib/Modelsphp.php';
$f=new Modelsphp();
if(isset($_POST['submit']))
{
     $name= trim($_POST['name']);
       $user= trim($_POST['username']);
        $pass=trim($_POST['password']);
        $defa=$_POST['ckbdef']=='1'?1:0;
        $active=$_POST['ckbactive']=='1'?1:0;
    if(get_magic_quotes_gpc())
{
        $name= trim(mysqli_real_escape_string($_POST['name']));
        $user= trim(mysqli_real_escape_string($_POST['username']));
        $pass=trim(mysqli_real_escape_string($_POST['password']));
        $defa=$_POST['ckbdef']=='1'?1:0;
        $active=$_POST['ckbactive']=='1'?1:0;
}
 
    

        
$f->addUser($name, $user, $pass, $defa, $active);
//header("Location:home.php");
}
 else {
    

    echo 'ko gui';
 }
